import bpy

from .utils import ASSET_PATH
from ..utils.preferences import Preferences
import unittest


class TestProperty(Preferences,
                   unittest.TestCase,
                   ):

    def test_preferences_property(self):
        pref = self.pref

        pref.icon_size = 1
        pref.icon_size = 5
        pref.load_preview_icon_size = "256"
        pref.load_preview_icon_size = "128"

        pref.show_preferences_property = False
        pref.show_preferences_property = True

        pref.asset_root_path = ASSET_PATH

        pref.mode = "ASSET"
        pref.show_type = "OBJECT"

        self.assertEqual(bpy.ops.asset.render_master_clear_asset(), {"FINISHED"})
        self.assertEqual(bpy.ops.asset.render_master_load_asset(), {"FINISHED"})
